<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Ellegance Shopping</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="../css/images/favicon.ico" />
<link rel="stylesheet" href="../css/style.css" type="text/css"
	media="all" />
<link rel="stylesheet" href="../css/prettyCheckboxes.css"
	type="text/css" media="all" />
<script src="../js/jquery-1.7.min.js" type="text/javascript"></script>
<script src="../js/jquery.jcarousel.js" type="text/javascript"></script>
<script src="../js/prettyCheckboxes.js" type="text/javascript"></script>
<script src="../js/DD_belatedPNG-min.js" type="text/javascript"></script>
<script src="../js/functions.js" type="text/javascript"></script>
<script>
function validatefname()
{
var x=document.forms["myForm"]["fname"].value;
if (x==null || x=="")
  {
  alert("First name must be filled out");
  return false;
  }
}
function validatelname()
{
var y=document.forms["myForm"]["lname"].value;
if (y==null || y=="")
  {
  alert("Last name must be filled out");
  return false;
  }
}
function validateEmail()
{
var z=document.forms["myForm"]["eid"].value;
if (z==null || z=="")
  {
  alert("Email ID must be filled out");
  return false;
  }
var x=document.forms["myForm"]["eid"].value;
var atpos=x.indexOf("@");
var dotpos=x.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
  {
  alert("Not a valid e-mail address");
  return false;
  }
 }
function validatepwd()
{
var m=document.forms["myForm"]["pass"].value;
if (m==null || m=="")
  {
  alert("password must be filled out");
  return false;
  }
}
function validatecwd()
{
var z=document.forms["myForm"]["cpass"].value;
if (z==null || z=="")
  {
  alert("Confirm password must be filled out");
  return false;
  }
}
function validateadd()
{
var z=document.forms["myForm"]["add"].value;
if (z==null || z=="")
  {
  alert("Address must be filled out");
  return false;
  }
}
function validatecity()
{
var z=document.forms["myForm"]["city"].value;
if (z==null || z=="")
  {
  alert("City must be filled out");
  return false;
  }
}
function validatestate()
{
var z=document.forms["myForm"]["state"].value;
if (z==null || z=="")
  {
  alert("State must be filled out");
  return false;
  }
}
function validatecon()
{
var z=document.forms["myForm"]["con"].value;
if (z==null || z=="")
  {
  alert("Country must be filled out");
  return false;
  }
}
function validateEmailname()
{
var x=document.forms["myForm"]["eid"].value;
var atpos=x.indexOf("@");
var dotpos=x.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
  {
  alert("Not a valid e-mail address");
  return false;
  }
}

function checkPass()
{
    //Store the password field objects into variables ...
    var pass1 = document.getElementById('pwd');
    var pass2 = document.getElementById('cwd');
    //Store the Confimation Message Object ...
    var message = document.getElementById('confirmMessage');
    //Set the colors we will be using ...
    var goodColor = "#66cc66";
    var badColor = "#ff6666";
    //Compare the values in the password field 
    //and the confirmation field
    if(pass1.value == pass2.value){
        //The passwords match. 
        //Set the color to the good color and inform
        //the user that they have entered the correct password 
        pass1.style.backgroundColor = goodColor;
        message.style.color = goodColor;
        message.innerHTML = "Passwords Match!"
    }else{
        //The passwords do not match.
        //Set the color to the bad color and
        //notify the user.
        pass2.style.backgroundColor = badColor;
        message.style.color = badColor;
        message.innerHTML = "Passwords Do Not Match!"
    }
}  
</script>
</head>
<body>
	<div>
		<div>
			<jsp:include page="header.jsp"></jsp:include>
		</div>
		<div id="reg" style="height: 500px; width: 500px; color: #999999">
		
			<form method="post" name="myForm" onsubmit="return validatefname()">
			<table>
			<tr>
				<td>
					Email id :
				</td>
				<td>
					<input type="text" name="eid" value="" onblur="return validateEmail()" /><br />
				</td>
			</tr>
			<tr>
				<td>
					 Password : 
				</td>
				<td>
					<input type="password" id="pwd" name="pass" value="" onblur="return validatepwd()" /> <br />
				 </td>	
			</tr>	
			<tr>
				<td>	
					Confirm Password : 
				</td>
				<td>	
					<input type="password" id="cwd" name="cpass" value="" onblur="return validatecwd()" onkeyup="checkPass(); return false;" /> 
					<br /> <span id="confirmMessage" class="confirmMessage"></span><br />
				</td>
			</tr>	
			<tr>
				<td>
				
					 First Name : 
				</td>
				<td>
					 
					 <input type="text" name="fname" value="" onblur="return validatefname()" /><br />
				</td>
			</tr>
			<tr>
				<td>
				
				Last Name : 
				</td>
				<td>
				 	<input	type="text" name="lname" value="" onblur="return validatelname()" /><br />
				 </td>
			</tr>
			<tr>
				<td>
				
				Address: 
				</td>
				<td>
					<textarea name="add" cols="15" rows="5" onblur="return validateadd()"></textarea>
				</td>
			</tr>
			<tr>
				<td>
				 City: 
				 </td>
				 <td>
				 	<select name="city"onblur="return validatecity()">
					<option value="Ahmedabad">Ahmedabad</option>
					<option value="baroda">baroda</option>
					<option value="surat">surat</option>
				</select>
				</td>
			</tr>
			
			<tr>
				<td>
			 		State:
			 		
			 	</td>
			 	<td>
			 	 <select name="state"
					onblur="return validatestate()">
					<option value="guj">Gujarat</option>
					<option value="raj">Rajasthan</option>
				</select>
				</td>
			</tr>
			<tr>
				<td>
				
			 Country: 
				</td>
				<td>
						 
				 <select name="con" onblur="return validatecon()">
					<option value="india">India</option>
					<option value="us">US</option>
					<option value="uk">UK</option>
				</select>
				</td>
			</tr>
			<tr>
				<td>
					<input type="submit" name="sumit" value="submit" />
				</td>
			</tr>
			</table>	
			</form>
		</div>
		<div>
			<jsp:include page="footer.jsp"></jsp:include>
		</div>
	</div>
</body>
</html>